//
// BSS descriptor DataBase management global function
//

void vBSSdescriptionInit(PWB32_ADAPTER Adapter);
void vBSSfoundList(PWB32_ADAPTER Adapter);
UCHAR boChanFilter(PWB32_ADAPTER Adapter, UCHAR ChanNo);
USHORT wBSSallocateEntry(PWB32_ADAPTER Adapter);
USHORT wBSSGetEntry(PWB32_ADAPTER Adapter);
void vSimpleHouseKeeping(PWB32_ADAPTER Adapter);
USHORT wBSShouseKeeping(PWB32_ADAPTER Adapter);
void ClearBSSdescpt(PWB32_ADAPTER Adapter, USHORT i);
USHORT wBSSfindBssID(PWB32_ADAPTER Adapter, UCHAR *pbBssid);
USHORT wBSSfindDedicateCandidate(PWB32_ADAPTER Adapter, struct SSID_Element *psSsid, UCHAR *pbBssid);
USHORT wBSSfindMACaddr(PWB32_ADAPTER Adapter, UCHAR *pbMacAddr);
USHORT wBSSsearchMACaddr(PWB32_ADAPTER Adapter, UCHAR *pbMacAddr, UCHAR band);
USHORT wBSSaddScanData(PWB32_ADAPTER, USHORT, psRXDATA);
USHORT wBSSUpdateScanData(PWB32_ADAPTER Adapter, USHORT wBssIdx, psRXDATA psRcvData);
USHORT wBSScreateIBSSdata(PWB32_ADAPTER Adapter, PWB_BSSDESCRIPTION psDesData);
void DesiredRate2BSSdescriptor(PWB32_ADAPTER Adapter, PWB_BSSDESCRIPTION psDesData,
							 UCHAR *pBasicRateSet, UCHAR BasicRateCount,
							 UCHAR *pOperationRateSet, UCHAR OperationRateCount);
void DesiredRate2InfoElement(PWB32_ADAPTER Adapter, UCHAR	*addr, USHORT *iFildOffset,
							 UCHAR *pBasicRateSet, UCHAR BasicRateCount,
							 UCHAR *pOperationRateSet, UCHAR OperationRateCount);
void BSSAddIBSSdata(PWB32_ADAPTER Adapter, PWB_BSSDESCRIPTION psDesData);
BOOL boCmpMacAddr( PUCHAR, PUCHAR );
BOOL boCmpSSID(struct SSID_Element *psSSID1, struct SSID_Element *psSSID2);
USHORT wBSSfindSSID(PWB32_ADAPTER Adapter, struct SSID_Element *psSsid);
USHORT wRoamingQuery(PWB32_ADAPTER Adapter);
void vRateToBitmap(PWB32_ADAPTER Adapter, USHORT index);
UCHAR bRateToBitmapIndex(PWB32_ADAPTER Adapter, UCHAR bRate);
UCHAR bBitmapToRate(UCHAR i);
BOOL boIsERPsta(PWB32_ADAPTER Adapter, USHORT i);
BOOLEAN boCheckConnect(PWB32_ADAPTER Adapter);
BOOLEAN boCheckSignal(PWB32_ADAPTER Adapter);
void AddIBSSIe(PWB32_ADAPTER Adapter,PWB_BSSDESCRIPTION psDesData );//added by ws for WPA_None06/01/04
void BssScanUpToDate(PWB32_ADAPTER Adapter);
void BssUpToDate(PWB32_ADAPTER Adapter);
void RateSort(UCHAR *RateArray, UCHAR num, UCHAR mode);
void RateReSortForSRate(PWB32_ADAPTER Adapter, UCHAR *RateArray, UCHAR num);
void Assemble_IE(PWB32_ADAPTER Adapter, USHORT wBssIdx);
void SetMaxTxRate(PWB32_ADAPTER Adapter);

void CreateWpaIE(PWB32_ADAPTER Adapter, USHORT* iFildOffset, PUCHAR msg, struct  Management_Frame* msgHeader,
				 struct Association_Request_Frame_Body* msgBody, USHORT iMSindex); //added by WS 05/14/05

#ifdef _WPA2_
void CreateRsnIE(PWB32_ADAPTER Adapter, USHORT* iFildOffset, PUCHAR msg, struct  Management_Frame* msgHeader,
				 struct Association_Request_Frame_Body* msgBody, USHORT iMSindex);//added by WS 05/14/05

USHORT SearchPmkid(PWB32_ADAPTER Adapter, struct  Management_Frame* msgHeader,
				   struct PMKID_Information_Element * AssoReq_PMKID );
#endif





